Skip to content

Device tree driver basics done#30

Merged
frogrammer9 merged 16 commits into
Operacja-System:mainfrom
Kamilosok:main
Jun 1, 2025
Merged

Device tree driver basics done#30
frogrammer9 merged 16 commits into
Operacja-System:mainfrom
Kamilosok:main

Conversation

@Kamilosok

Copy link
Copy Markdown
Collaborator

Basic implementation of a device tree parser/driver. It validates the FDT header, walks through the structure block recursively, and builds a tree of nodes and properties. Currently, values can be read as 32- or 64-bit integers.
Memory management is handled using a simple arena allocator. The parser is able to locate the UART node and read its base address correctly.

crusom and others added 7 commits May 26, 2025 22:44
Implements basic device tree functions for outside programs, all underlying logic implemented, untested
Fixed Cmake issues, fixed compilation errors, added a dedicated dtree example for testing
Basic device tree operations work, as shown with the example uart search
@Kamilosok

Copy link
Copy Markdown
Collaborator Author

Uart included in package

@Kamilosok Kamilosok linked an issue May 27, 2025 that may be closed by this pull request

@qbojj qbojj left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • All ((void*)0) should be nullptr
  • Move private headers out of /include
  • Some files don't have trailing new line

Comment thread src/drivers/dt/dt_parser.c Outdated
Comment thread src/drivers/dt/dt_parser.c Outdated
Comment thread include/drivers/dt/dt.h Outdated
Comment thread include/drivers/dt/dt.h Outdated
Comment thread include/drivers/dt/dt_props.h
Comment thread src/drivers/dt/dt_alloc.c Outdated
Comment thread src/drivers/dt/dt_parser.c Outdated
Comment thread src/drivers/dt/dt_parser.c Outdated
Comment thread src/drivers/dt/dt_parser.c Outdated
Comment thread src/drivers/dt/dt_parser.c Outdated
That includes actual null pointers, corrected the location of headers, some formatting, unnecessary copying of data, moved functions to more appropriate places, additional failsafes, and some additional access features
@Kamilosok

Copy link
Copy Markdown
Collaborator Author

New version, numerous improvements

Comment thread include/drivers/console.h Outdated
Comment thread include/drivers/dt/dt.h Outdated
Comment thread include/drivers/dt/dt_props.h Outdated
Comment thread include/drivers/dt/dt.h Outdated
Comment thread include/drivers/uart.h Outdated
Comment thread src/drivers/dt/dt_node.h Outdated
Comment thread src/drivers/dt/dt_parser.c Outdated
Comment thread src/drivers/uart.c Outdated
Comment thread src/lib/debug/debug_stdio.c Outdated
Comment thread src/lib/stdbigos/buffer.c Outdated

@GoscZnickiem GoscZnickiem left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

Comment thread src/drivers/dt/dt_access.c Outdated
Comment thread include/stdbigos/buffer.h Outdated
Comment thread src/drivers/console.c Outdated
Comment thread src/drivers/console.c Outdated
Comment thread src/drivers/dt/CMakeLists.txt Outdated
Comment thread src/drivers/dt/CMakeLists.txt Outdated
Comment thread src/drivers/dt/dt_node.h
@Operacja-System Operacja-System deleted a comment from GoscZnickiem May 30, 2025
Comment thread include/stdbigos/bitutils.h Outdated
Comment thread src/drivers/dt/dt_init.c Outdated
Comment thread include/drivers/dt/dt_props.h Outdated
Comment thread include/stdbigos/buffer.h Outdated
Comment thread src/drivers/dt/dt_access.c Outdated
Comment thread src/drivers/dt/dt_parser.h Outdated
Comment thread src/example_dtree/CMakeLists.txt
Comment thread src/example_dtree/entry.c Outdated
Comment thread src/example_sbi/CMakeLists.txt
Comment thread src/lib/stdbigos/buffer.c Outdated
@Kamilosok Kamilosok force-pushed the main branch 4 times, most recently from 9212d26 to 6f2b00b Compare June 1, 2025 01:09
@Kamilosok

Copy link
Copy Markdown
Collaborator Author

I think that's everything done v2

@Kamilosok Kamilosok requested review from GoscZnickiem, frogrammer9 and qbojj and removed request for qbojj June 1, 2025 01:13
Comment thread include/stdbigos/buffer.h
Comment thread src/drivers/dt/dt_access.c Outdated
Comment thread src/drivers/dt/dt_alloc.h
Comment thread src/drivers/dt/dt_parser.c
Comment thread include/drivers/dt/dt.h
@Kamilosok Kamilosok force-pushed the main branch 3 times, most recently from f12e975 to 4faa27a Compare June 1, 2025 13:12
@Kamilosok

Copy link
Copy Markdown
Collaborator Author

Last @qbojj comments addressed, also improved some debug configurations

@Kamilosok Kamilosok requested a review from qbojj June 1, 2025 13:14

@GoscZnickiem GoscZnickiem left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won't release you just yet

Comment thread include/stdbigos/buffer.h Outdated
GoscZnickiem
GoscZnickiem previously approved these changes Jun 1, 2025

@GoscZnickiem GoscZnickiem left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

frogrammer9
frogrammer9 previously approved these changes Jun 1, 2025

@frogrammer9 frogrammer9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only nitpicks other then that LGTM.

Comment thread include/stdbigos/bitutils.h Outdated
Comment thread src/drivers/dt/dt_init.c
Comment thread src/drivers/dt/dt_parser.c Outdated
@frogrammer9 frogrammer9 merged commit d2f270e into Operacja-System:main Jun 1, 2025
5 checks passed
frogrammer9 added a commit to frogrammer9/BigOS that referenced this pull request Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Device tree driver

5 participants